<?php include PATH_VIEWS . 'common/header.php'; ?>
<div class="main">
    <?php include PATH_VIEWS . 'common/left.php'; ?>
    <div class="main_right welcome_right" id="slide">
        <dl>
            <dt><h3>操作说明 <span>[关闭/展开]</span></h3></dt>
            <dd class="border">
                <span>以下红色边框的表单是必填项 。</span>
            </dd>
        </dl>
        <dl>
            <dt class="bottom">
            <h4>添加商品</h4>
            </dt>
            <dd>
                <form id="form1" name="form1" method="post" enctype="multipart/form-data" action="<?php echo URL; ?>">
                    <table class="system_envir from_demo"> 
                        <tr>
                            <td>上级菜单名称</td>
                            <td class="sanji">
                                <select name="FcateIds[]" onchange="getMenu(this.value)">
                                    <option value="0">顶级</option>
                                    <?php foreach ($menu_list as $ls) { ?>
                                        <option value="<?php echo $ls['Fid']; ?>"><?php echo $ls['Fname']; ?></option>
                                    <?php } ?>
                                </select>
                                <select id="showMenu" name="FcateIds[]" class="hide" onchange="getSub(this.value)">

                                </select>
                                <select id="subMenu" name="FcateIds[]" class="hide">

                                </select>
                            </td>
                            <td></td>
                        </tr>
                        <tr class="email">
                            <td>商品标题</td>
                            <td><input class="border_red" type="text" id="menuVal" name="Ftitle" value="" maxlength="64" style="width: 80%" data-rule="商品标题:required;length[2~64]" data-target="#tiShi"/></td>
                            <td id="tiShi">在填写商品名称时，请注意简短且要具有概括性。字符长度：2-64个</td>
                        </tr>
                        <tr>
                            <td>商品子标题</td>
                            <td><input type="text" id="menuVal" name="Fstitle" value="" maxlength="64" style="width: 80%"/></td>
                            <td>在填写商品名称时，请注意简短且要具有概括性。字符长度：2-16个</td>
                        </tr>
                        <tr>
                            <td>商品英文名</td>
                            <td><input type="text" id="menuVal" name="FenTitle" value="" maxlength="64" style="width: 80%"/></td>
                            <td>在填写商品名称时，请注意简短且要具有概括性。字符长度：2-16个</td>
                        </tr>
                        <tr>
                            <td>商品主图</td>
                            <td><input type="file" id="sort" name="Fimg" style="width:auto"/></td>
                            <td class="tishi">产品的主图</td>
                        </tr>
                        <tr>
                            <td>商品分类信息</td>
                            <td>
                                <select name="FinfoIds[]">
                                    <option value="0">选择商品品牌</option>
                                    <?php foreach ($info_list_array[1] as $ls) { ?>
                                        <option value="<?php echo $ls['Fid']; ?>"><?php echo $ls['Fname']; ?></option>
                                    <?php } ?>
                                </select>
                                <select name="FinfoIds[]">
                                    <option value="0">选择商品产地</option>
                                    <?php foreach ($info_list_array[3] as $ls) { ?>
                                        <option value="<?php echo $ls['Fid']; ?>"><?php echo $ls['Fname']; ?></option>
                                    <?php } ?>
                                </select>
                                <select name="FinfoIds[]">
                                    <option value="0">选择商品包装</option>
                                    <?php foreach ($info_list_array[4] as $ls) { ?>
                                        <option value="<?php echo $ls['Fid']; ?>"><?php echo $ls['Fname']; ?></option>
                                    <?php } ?>
                                </select>
                            </td>
                            <td id="tishix">字符为2-16个字</td>
                        </tr>
                        <tr>
                            <td>商品分类信息</td>
                            <td>
                                <select name="FinfoIds[]">
                                    <option value="0">选择商品功效</option>
                                    <?php foreach ($info_list_array[6] as $ls) { ?>
                                        <option value="<?php echo $ls['Fid']; ?>"><?php echo $ls['Fname']; ?></option>
                                    <?php } ?>
                                </select>
                                <select name="FinfoIds[]">
                                    <option value="0">选择商品使用肤质</option>
                                    <?php foreach ($info_list_array[7] as $ls) { ?>
                                        <option value="<?php echo $ls['Fid']; ?>"><?php echo $ls['Fname']; ?></option>
                                    <?php } ?>
                                </select>
                                <select name="FinfoIds[]">
                                    <option value="0">选择商品适合的肤龄</option>
                                    <?php foreach ($info_list_array[8] as $ls) { ?>
                                        <option value="<?php echo $ls['Fid']; ?>"><?php echo $ls['Fname']; ?></option>
                                    <?php } ?>
                                </select>
                            </td>
                            <td id="tishix">字符为2-16个字</td>
                        </tr>
                        <tr>
                            <td>商品分类信息</td>
                            <td>
                                <select name="FinfoIds[]">
                                    <option value="0">选择商品规格</option>
                                    <?php foreach ($info_list_array[5] as $ls) { ?>
                                        <option value="<?php echo $ls['Fid']; ?>"><?php echo $ls['Fname']; ?></option>
                                    <?php } ?>
                                </select>
                                <select name="FinfoIds[]">
                                    <option value="0">选择香水香调</option>
                                    <?php foreach ($info_list_array[9] as $ls) { ?>
                                        <option value="<?php echo $ls['Fid']; ?>"><?php echo $ls['Fname']; ?></option>
                                    <?php } ?>
                                </select>
                            </td>
                            <td id="tishix">字符为2-16个字</td>
                        </tr>
                        <tr>
                            <td>商品市场价格</td>
                            <td><input class="border_red" type="text" id="sort" name="Fprice" value="" maxlength="10" data-rule="商品价格:required:integer;length[1~5]" data-target="#tishij"/></td>
                            <td id="tishij">产品的市场价格，不是产品的实际价格</td>
                        </tr>
                        <tr>
                            <td>商品实际价格</td>
                            <td><input type="text" id="sort" name="Fdiscount" value="" maxlength="3" data-rule="integer;range[0~10];length[1~2]" data-target="#tishiz"/></td>
                            <td id="tishiz">商品的实际价格，折扣算出来</td>
                        </tr>
                        <tr>
                            <td>商品运费</td>
                            <td><input type="text" id="sort" name="Fpostage" value="" maxlength="10"/></td>
                            <td class="tishi">商品的运费，不填写默认为包邮</td>
                        </tr>
                        <tr>
                            <td>产品总数量</td>
                            <td><input type="text" id="sort" name="FproudctNum" value="1" maxlength="5"/></td>
                            <td class="tishi">产品的总数量</td>
                        </tr>
                        <tr>
                            <td>排序</td>
                            <td class="sort"><input type="text" id="sort" name="Fsort" value="1" maxlength="2"/></td>
                            <td class="tishi">数值越小，排列越前，数值大小范围：1-99</td>
                        </tr>
                        <tr>
                            <td>商品描述</td>
                            <td colspan="2" style="padding: 5px">
                                <script type="text/javascript" src="<?php echo HTTP_EXTENDS; ?>ueditor1/ueditor.config.js"></script>
                                <!-- 编辑器源码文件 -->
                                <script type="text/javascript" src="<?php echo HTTP_EXTENDS; ?>ueditor1/ueditor.all.js"></script>
                                <!-- 实例化编辑器 -->
                                <script id="edit" name="Fdetails" type="text/plain"></script>
                            </td>                           
                        </tr>
                        <tr>
                            <td>是否为限时抢购</td>
                            <td>
                                <select name="FlimitBuy" style="width: 60px">
                                    <option value="0">否</option>                           
                                    <option value="1">是</option>
                                </select>
                            </td>
                            <td>商品状态，决定商品是否可以购买</td>
                        </tr>
                        <tr>
                            <td>商品状态</td>
                            <td>
                                <select name="Fstatus" style="width: 60px">
                                    <option value="1">上架</option>                           
                                    <option value="0">下架</option>
                                </select>
                            </td>
                            <td>商品状态，决定商品是否可以购买</td>
                        </tr>
                        <tr>
                            <td></td>
                            <td class="subbtn" colspan="2">
                                <input class="ok" type="submit" name="ok" value="确认提交">
                                <a href="javascript:void(0)" class="cancel">返回</a>
                            </td>
                        </tr>
                    </table>
                </form>
            </dd>
        </dl>
        <div id="test"></div>
    </div>
</div>
<?php include PATH_VIEWS . 'common/footer.php'; ?>
<script>
                                    function getMenu(parent_id) {
                                        if (parent_id == "0" || parent_id == "") {
                                            $("#showMenu").addClass("hide");
                                        } else {
                                            $("#showMenu").removeClass("hide");
                                        }

//    取二级菜单
                                        $.get('index.php?C=Web&A=menuGrade&pid=' + parent_id, function (data) {
                                            $('#showMenu').html(data);
                                        });
                                    }
                                    function getSub(sub_id) {
                                        if (sub_id == "0" || sub_id == "") {
                                            $("#subMenu").addClass("hide");
                                        } else {
                                            $("#subMenu").removeClass("hide");
                                        }
                                        //    取三级菜单
                                        $.get('index.php?C=Web&A=menuSub&pid=' + sub_id, function (data) {
                                            $('#subMenu').html(data);
                                        });
                                    }
</script>
<script>
    var ue = UE.getEditor('edit', {
        emotionLocalization: true,
        maximumWords: 1000,
        initialFrameWidth: 1000,
        initialFrameHeight: 200,
    });

</script>